#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long LL;
const LL EPS = 1;
LL fnl(LL x, LL n) {
    LL ret = x;
    LL t = x;
    while(--n) {
        t = (t%2==0? t/2: t/2+1);
        ret += t;
    }
    return ret;
}
LL ANS(LL n, LL m) {
    LL l = 0;
    LL r = m+m;
    while (l+EPS < r) {
        LL mid = (l+r)/2;
        if (fnl(mid, n)<=m) l=mid;
        else r=mid;
    }
    return l;
}
int main(int argc, char** argv) {
    LL n,m;
    cin>>n>>m;
    cout<<ANS(n, m)<<endl;
    return 0;
}
